import Vue from "vue"
import VueRouter from "vue-router"

Vue.use(VueRouter)

const routes = [
  {
    path: "/",
    redirect: "/task/detail"
  },
  // 任务列表
  {
    path: "/task/list",
    name: "taskList",
    meta: {
      keepAlive: true
    },
    component: () => import("@/views/task/list.vue")
  },
  // 任务搜索
  {
    path: "/task/search",
    name: "taskSearch",
    component: () => import("@/views/task/search.vue")
  },
  // 任务详情
  {
    path: "/task/detail",
    name: "taskDetail",
    component: () => import("@/views/task/detail.vue")
  },
  // 添加流程
  {
    name: "processAdd",
    path: "/process/add",
    component: () => import("@/views/process/add.vue")
  },
  // 流程详情
  {
    name: "processDetail",
    path: "/process/detail",
    component: () => import("@/views/process/detail.vue")
  },

  // 派单
  {
    name: "task/allotTask",
    path: "/task/allotTask",
    component: () => import("@/views/SendSingle")
  }
]

const router = new VueRouter({
  routes
})

export default router
